<template>
  <el-menu :default-openeds="['2']" style="min-height: 100%; overflow-x: hidden"
           background-color="rgb(48,65,87)"
           text-color="#fff"
           :collapse-transition="false"
           :collapse="isCollapse"
           router
  >
    <div style="height: 60px;line-height: 60px;text-align: center">
      <img src="../img/logo.png" style="width: 18px; position: relative; top: 5px;margin-right: 5px">
      <b style="color: aliceblue" v-show="showtext">后台管理系统</b>
    </div>
<!--    <div v-for="item in menus" :key="item.id">-->
<!--      <div v-if="item.path">-->
<!--        <el-menu-item :index="item.path">-->
<!--          <i :class="item.icon"></i>-->
<!--          <span slot="title">{{ item.name }}</span>-->
<!--        </el-menu-item>-->
<!--      </div>-->
<!--      <div v-else>-->
<!--        <el-submenu :index="item.id+''">-->
<!--          <template slot="title">-->
<!--            <i :class="item.icon"></i>-->
<!--            <span slot="title">{{ item.name }}</span>-->
<!--          </template>-->
<!--          <div v-for="subItem in item.children" :key="subItem.id">-->
<!--            <el-menu-item :index="subItem.path">-->
<!--              <i :class="subItem.icon"></i>-->
<!--              <span slot="title">{{ subItem.name }}</span>-->
<!--            </el-menu-item>-->
<!--          </div>-->
<!--        </el-submenu>-->
<!--      </div>-->
<!--    </div>-->

    <el-menu-item index="/">
            <template slot="title">
              <i class="el-icon-monitor"></i>
              <span slot="title">主页</span>
            </template>
    </el-menu-item>
    <el-submenu index="2">
      <template slot="title"><i class="el-icon-s-custom"></i>
        <span slot="title">用户管理</span>
      </template>
        <el-menu-item index="/kehu">用户</el-menu-item>
    </el-submenu>
    <el-submenu index="3">
      <template slot="title"><i class="el-icon-brush"></i>
        <span slot="title">社区维修管理</span>
      </template>
        <el-menu-item index="/fix">故障报修</el-menu-item>
    </el-submenu>
    <el-submenu index="4">
      <template slot="title"><i class="el-icon-tickets"></i>
        <span slot="title">意见征集管理</span>
      </template>
        <el-menu-item index="/complaint">意见反馈</el-menu-item>
    </el-submenu>
    <el-submenu index="5">
      <template slot="title"><i class="el-icon-truck"></i>
        <span slot="title">社区车位管理</span>
      </template>
        <el-menu-item index="/carport">车位信息</el-menu-item>
    </el-submenu>
    <el-submenu index="7">
      <template slot="title"><i class="el-icon-office-building"></i>
        <span slot="title">社区信息管理</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="/file">文件管理</el-menu-item>
        <el-menu-item index="/forum">社区论坛</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
    <el-submenu index="8">
      <template slot="title"><i class="el-icon-shopping-cart-2"></i>
        <span slot="title">同城社区管理</span>
      </template>
        <el-menu-item index="/service">同城服务</el-menu-item>
    </el-submenu>
    <el-submenu index="11">
      <template slot="title"><i class="el-icon-s-promotion"></i>
        <span slot="title">爱心关怀管理</span>
      </template>
        <el-menu-item index="/helpold">爱心关怀</el-menu-item>
    </el-submenu>
    <el-submenu index="13">
      <template slot="title"><i class="el-icon-setting"></i>
        <span slot="title">系统管理</span>
      </template>
      <el-menu-item-group>
        <template slot="title">权限管理</template>
        <el-menu-item index="/role">角色权限</el-menu-item>
        <el-menu-item index="/menu">菜单管理</el-menu-item>
      </el-menu-item-group>
      <el-menu-item-group title="前台">
        <el-menu-item index="/front/home">用户端</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
  </el-menu>
</template>

<script>
export default {
  name: "Aside",
  props:{
    isCollapse: Boolean,
    showtext: Boolean
  },
  data(){
    return{
      menus:localStorage.getItem("menus")?JSON.parse(localStorage.getItem("menus")):[]
    }

  }
}
</script>

<style scoped>

</style>